package smetana.domain.raw;

import java.sql.Date;
import com.google.common.base.Preconditions;
import static org.apache.commons.lang.StringUtils.defaultString;

public class PositionToSupplier {
    private int positionId;
    private int supplierId;
    private String externalId;
    private Date dateStart;
    private Date dateEnd;

    protected PositionToSupplier(){
        //used by iBatis.
    }

    public PositionToSupplier(int positionId, int supplierId, String externalId){
        this.positionId=positionId;
        this.supplierId=supplierId;
        this.externalId=Preconditions.checkNotNull(externalId);
    }

    public int getPositionId(){
        return this.positionId;
    }

    public void setPositionId(int positionId){
        this.positionId = positionId;
    }
    public int getSupplierId(){
        return this.supplierId;
    }

    public void setSupplierId(int supplierId){
        this.supplierId = supplierId;
    }
    public String getExternalId(){
        return defaultString(this.externalId);
    }

    public void setExternalId(String externalId){
        this.externalId = Preconditions.checkNotNull(externalId);
    }
    public Date getDateStart(){
        return this.dateStart;
    }

    public void setDateStart(Date dateStart){
        this.dateStart = Preconditions.checkNotNull(dateStart);
    }
    public Date getDateEnd(){
        return this.dateEnd;
    }

    public void setDateEnd(Date dateEnd){
        this.dateEnd = Preconditions.checkNotNull(dateEnd);
    }
}